package cn.gene.timeyan.pojo.coo.dto;

import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;

import javax.validation.constraints.Max;
import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.util.Date;

@Data
@ApiModel("互助详情")
public class CooperationDTO implements Serializable {
    @ApiModelProperty(value = "求助id", required = true)
    private Long helpId;

    @NotNull(message = "用户id不能为空")
    @ApiModelProperty(value = "用户id", required = true)
    private Long userId;

    @NotNull(message = "求助难度不能为空")
    @ApiModelProperty(value = "求助难度", required = true)
    private String difficulty;

    @ApiModelProperty(value = "求助标题", required = true)
    @NotNull(message = "请输入求助标题")
    private String helpTitle;

    @ApiModelProperty(value = "求助内容", required = true)
    @NotNull(message = "请输入求助内容")
    private String helpContent;

    @JsonFormat(pattern = "yyyy-MM-dd HH:mm",timezone = "GMT+8")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm")
    @ApiModelProperty(value = "求助开始时间", required = true)
    @NotNull(message = "请输入求助开始时间")
    private Date startTime;

    @JsonFormat(pattern = "yyyy-MM-dd HH:mm",timezone = "GMT+8")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm")
    @ApiModelProperty(value = "求助结束时间", required = true)
    @NotNull(message = "请输入求助结束时间")
    private Date endTime;

    @ApiModelProperty(value = "求助类型", required = true)
    @NotNull(message = "请输入求助类型")
    private String applyType;

    @ApiModelProperty(value = "求助地址", required = true)
    @NotNull(message = "请输入求助地址")
    private String address;

    @ApiModelProperty(value = "学校", required = true)
    @NotNull(message = "请输入学校名称")
    private String school;

    @ApiModelProperty(value = "揭榜上限", required = true)
    @Max(message = "揭榜上限", value = 10)
    private Integer applyLimit;

    @ApiModelProperty(value = "已揭榜数", required = true)
    @NotNull(message = "已揭榜数不能为空且不能大于揭榜上限")
    private Integer applyBelimit;

    @ApiModelProperty(value = "模块类别", required = true)
    @NotNull(message = "请选择模块类别")
    private Long moduleId;

    @ApiModelProperty(value = "求助状态",example="0", required = true)
    @NotNull(message = "请选择求助状态，1:已完成；0:未完成")
    private String helpState;

    @ApiModelProperty(value = "报酬", required = true)
    @NotNull(message = "请输入报酬")
    private Integer rewardValue;

    @ApiModelProperty(value = "报酬类型", required = true)
    @NotNull(message = "请输入报酬类型")
    private String rewardType;

}
